package com.aliyun.messagemgt.controller;

import com.aliyun.messagemgt.application.service.OperateLogService;
import com.aliyun.messagemgt.dto.query.OperateLogQuery;
import com.aliyun.messagemgt.web.controller.OperateLogController;
import com.github.pagehelper.PageInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

import java.util.ArrayList;

/**
 * @author wenyaxin
 * @date 2020/12/2
 */
@RunWith(MockitoJUnitRunner.class)
public class OperateLogControllerTest {

    @InjectMocks
    private OperateLogController operateLogController;

    @Mock
    private OperateLogService operateLogService;

    @Test
    public void queryOperateLogTest(){
        Mockito.when(operateLogService.listOperateLog(Mockito.any())).thenReturn(new PageInfo());
        operateLogController.queryOperateLog(new OperateLogQuery());
    }

    @Test
    public void queryPendingEventListOwnerDeptTest(){
        Mockito.when(operateLogService.operateLogListOwnerDept(Mockito.any())).thenReturn(new ArrayList<>());
        operateLogController.queryPendingEventListOwnerDept(new OperateLogQuery());
    }

    @Test
    public void queryoperateLogListResourceTypeTest(){
        Mockito.when(operateLogService.operateLogListResourceType(Mockito.any())).thenReturn(new ArrayList());
        operateLogController.queryoperateLogListResourceType(new OperateLogQuery());
    }
}
